-- feature_item
-- create by cheny3
-- 功能物品

return {
    -- 判断
    canTrigger = function(args)
        local featureItems = AutoFightM.getData()["featureItems"];
        if featureItems and #featureItems > 0 then
            return true;
        end
        return false;
    end,

    -- 触发
    trigger = function(args)
        local featureItems = AutoFightM.getData()["featureItems"];
        if not featureItems or #featureItems <= 0 then
            return false;
        end

        -- 通过抛出事件来捡起物品(featureItem)
        EventMgr.fire(event.AUTO_PICK_FEATUREITEM, {["pos"] = featureItems[1],});
        return true;
    end,
};
